package com.ssm.springboot;

import org.apache.ibatis.annotations.Mapper;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.bind.Bindable;
import org.springframework.boot.context.properties.bind.Binder;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;

import java.util.List;


@SpringBootApplication
//@ComponentScan(basePackages = {"com.ssm.springboot.web","com.ssm.springboot.service"})
@MapperScan(basePackages = "com.ssm.springboot.dao")
public class SpringbootApplication {

	public static void main(String[] args) {
		ApplicationContext run = SpringApplication.run(SpringbootApplication.class, args);
		/*Binder binder = Binder.get(run.getEnvironment());
		List<String> post = binder.bind("com.didispace.post", Bindable.listOf(String.class)).get();
		System.out.println(post);
		List<PostInfo> posts = binder.bind("com.didispace.posts", Bindable.listOf(PostInfo.class)).get();
		System.out.println(posts);
		System.out.println(run.getEnvironment().containsProperty("xql.name"));
		System.out.println(run.getEnvironment().containsProperty("spring.datasource.username"));
		System.out.println(run.getEnvironment().containsProperty("spring.datasource.url"));
		String[] profiles = run.getEnvironment().getDefaultProfiles();
		System.out.println(profiles[0]);*/
	}
}
